/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tpdisenio2009.model.dao;

import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import tpdisenio2009.model.HibernateUtils;
import tpdisenio2009.model.beans.Score;
import tpdisenio2009.model.beans.SoccerMatch;
import tpdisenio2009.model.beans.TournamentDate;

/**
 *
 * @author Pablito
 */
public class SoccerMatchDAO extends AbstractDAO<SoccerMatch> {

    @Override
    public Class<SoccerMatch> getPersistentClass() {
        return SoccerMatch.class;
    }

    public List<SoccerMatch> getSoccerMatchByTournamentDate ( TournamentDate tournamentDate ) {
        Session session = HibernateUtils.getCurrentSession();

        Criteria criteria = session.createCriteria( SoccerMatch.class );
        criteria.add( Restrictions.eq( "tournamentDate", tournamentDate ) );

        return criteria.list();
    }

}
